package yesjava.news.service;

import yesjava.news.dao.UserDao;
import yesjava.news.dao.UserDaoImpl;
import yesjava.news.entity.User;

public class UserServiceImpl implements UserService {

    private UserDao userDao = new UserDaoImpl();
    @Override
    public User login(User user) {
        User user1 = userDao.selectUserByNameAndPassword(user.getName(), user.getPassword());
        return user1;
    }

    @Override
    public User getUserById(Integer id) {
        return userDao.selectUserId(id);
    }

}
